home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / CTFASMTT.ZIP / LESSON2.DOC < prev    next >
Text File  |  1994-10-30  |  2KB  |  38 lines

  1. LESSON 2 - BASIC OPERATORS
  2.  
  3. after we learned how a basic assembly program is built, we will
  4. learn some basic operators.
  5.  
  6. MOV destination,source : lets say "mov ax,bx" ax will become the value
  7.                          which bx stores.
  8. ADD destination,count  : lets say "add ax,bx" ax will be increased
  9.                          according to the value in bx - lets say
  10.                          ax = 10, bx = 2 then ax will become 12 (10+2)
  11. SUB destination,count  : lets say "add ax,bx" ax will be decreased
  12.                          according to the value in bx - lets say
  13.                          ax = 10, bx = 2 then ax will become 8 (10-2)
  14. INC destination        : lets say "inc ax" then ax will be ax+1
  15. DEC destination        : lets say "dec ax" then ax will be ax-1
  16. AND destination,count  : lets say "and ax,bx" then ax will be anded
  17.                          with bx, lets say ax = 1, bx = 0 then ax will
  18.                          be 0.
  19. OR  destination,count  : lets say "or ax,bx" then ax will be ored
  20.                          with bx, lets say ax = 1, bx = 0 then ax will
  21.                          be 1.
  22.  
  23. know after we learnt the basic command, what happend about the size of
  24. those registers well, you can't do one of those between registers
  25. which aren't not the same size : "mov ax,bl", "mov al,bx", "add cx,cl"
  26. and so on.
  27.  
  28. simple example, if we want to preform subtraction, what will do,
  29. (before each example check if you can do it your self) :
  30. mov ax,20        ; ax will be 20
  31. mov cx,10        ; cx will be 10
  32. sub ax,cx        ; ax will be 10 (ax-cx,20-10)
  33.  
  34. know if we have a number in hex or bin and we want to put it as it is so
  35. we will have to put "h" after the number for hex and "b" for bin :
  36.  
  37. mov ax,0a000h  ; you must have a zero before a letter in hex
  38. mov ax,010010b ; a simple number in binary